<template>
  <div class="not-found">
    <div class="error-container">
      <div class="error-icon">
        <el-icon :size="120" color="#C0C4CC">
          <Warning />
        </el-icon>
      </div>
      
      <div class="error-content">
        <h1 class="error-code">404</h1>
        <h2 class="error-title">页面未找到</h2>
        <p class="error-description">
          抱歉，您访问的页面不存在或已被移除。
        </p>
        
        <div class="error-actions">
          <el-button type="primary" size="large" @click="goHome" :icon="House">
            返回首页
          </el-button>
          
          <el-button size="large" @click="goBack" :icon="ArrowLeft">
            返回上页
          </el-button>
        </div>
        
        <div class="helpful-links">
          <p class="links-title">您可能想要访问：</p>
          <div class="links-list">
            <router-link to="/" class="helpful-link">
              <el-icon><TrendCharts /></el-icon>
              爆仓监控
            </router-link>
            
            <router-link to="/stats" class="helpful-link">
              <el-icon><DataBoard /></el-icon>
              系统统计
            </router-link>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 装饰性背景 -->
    <div class="background-decoration">
      <div class="decoration-circle circle-1"></div>
      <div class="decoration-circle circle-2"></div>
      <div class="decoration-circle circle-3"></div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import {
  Warning,
  House,
  ArrowLeft,
  TrendCharts,
  DataBoard
} from '@element-plus/icons-vue'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style lang="scss" scoped>
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
  
  .error-container {
    background: white;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    z-index: 2;
    
    .error-icon {
      margin-bottom: 24px;
    }
    
    .error-content {
      .error-code {
        font-size: 72px;
        font-weight: 700;
        color: #409EFF;
        margin: 0 0 16px 0;
        text-shadow: 2px 2px 4px rgba(64, 158, 255, 0.2);
      }
      
      .error-title {
        font-size: 28px;
        font-weight: 600;
        color: #303133;
        margin: 0 0 16px 0;
      }
      
      .error-description {
        font-size: 16px;
        color: #606266;
        margin: 0 0 32px 0;
        line-height: 1.6;
      }
      
      .error-actions {
        display: flex;
        gap: 16px;
        justify-content: center;
        margin-bottom: 32px;
        flex-wrap: wrap;
      }
      
      .helpful-links {
        .links-title {
          font-size: 14px;
          color: #909399;
          margin: 0 0 16px 0;
        }
        
        .links-list {
          display: flex;
          gap: 16px;
          justify-content: center;
          flex-wrap: wrap;
          
          .helpful-link {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: #F5F7FA;
            border-radius: 20px;
            color: #606266;
            text-decoration: none;
            font-size: 14px;
            transition: all 0.3s ease;
            
            &:hover {
              background: #409EFF;
              color: white;
              transform: translateY(-2px);
            }
            
            .el-icon {
              font-size: 16px;
            }
          }
        }
      }
    }
  }
  
  .background-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    
    .decoration-circle {
      position: absolute;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      animation: float 6s ease-in-out infinite;
      
      &.circle-1 {
        width: 200px;
        height: 200px;
        top: 10%;
        left: 10%;
        animation-delay: 0s;
      }
      
      &.circle-2 {
        width: 150px;
        height: 150px;
        top: 60%;
        right: 15%;
        animation-delay: 2s;
      }
      
      &.circle-3 {
        width: 100px;
        height: 100px;
        bottom: 20%;
        left: 20%;
        animation-delay: 4s;
      }
    }
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@media (max-width: 768px) {
  .not-found {
    .error-container {
      padding: 32px 24px;
      
      .error-content {
        .error-code {
          font-size: 56px;
        }
        
        .error-title {
          font-size: 24px;
        }
        
        .error-actions {
          flex-direction: column;
          align-items: center;
          
          .el-button {
            width: 200px;
          }
        }
        
        .helpful-links {
          .links-list {
            flex-direction: column;
            align-items: center;
            
            .helpful-link {
              width: 150px;
              justify-content: center;
            }
          }
        }
      }
    }
    
    .background-decoration {
      .decoration-circle {
        &.circle-1 {
          width: 120px;
          height: 120px;
        }
        
        &.circle-2 {
          width: 80px;
          height: 80px;
        }
        
        &.circle-3 {
          width: 60px;
          height: 60px;
        }
      }
    }
  }
}
</style>